package com.teama4.shop.controller;


import com.alibaba.fastjson.JSON;
import com.teama4.shop.annotation.SecurityParameter;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import scala.Int;


import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/encrypt")
public class EncryptController {

    @RequestMapping("testEncrypt")
    @SecurityParameter
    @ResponseBody
    public Object testEncrypt(HttpServletResponse response, @RequestBody String  data) {
        Map parse = JSON.parseObject(data,Map.class);
        String name = (String) parse.get("name");
        Integer age = (Integer) parse.get("age");
        Map res = new HashMap();
        res.put("result","ok");
        return res;
    }

}
